<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HTML>
<head>
<LINK href="test.css" rel="stylesheet" type="text/css">
</head>
<script type="text/JavaScript" src="accountCreateAjax.js"></script>
<script type="text/JavaScript">


  
function Validate()
{
    var pw1 = document.registration_form.password1.value;
    var pw2 = document.registration_form.passwordReType.value;
    if (document.registration_form.username.value == '') 
    {
        alert('Please fill in your desired username!');
        return false;
    }
    if (pw1 == '') 
    {
       alert('Please fill in your desired password!');
      return false;
    }
    if (pw2 == '') 
    {
       alert('Please fill in your password again for confirmation!');
      return false;
    }
    if ( pw1 != pw2 ) 
    {
        alert("The two passwords are not identical! "+
        "Please enter the same password again for confirmation");
        return false;
    }

}

function displayOptions(flag)
{
var DealerOnly = document.getElementById('dealerOnly');
var DealerOnly2 = document.getElementById('dealerOnly2');
var DealerOnly3 = document.getElementById('dealerOnly3');
var DealerOnly4 = document.getElementById('dealerOnly4');
var DealerOnly5 = document.getElementById('dealerOnly5');
var DealerOnly6 = document.getElementById('dealerOnly6');
var DealerOnly7 = document.getElementById('dealerOnly7');
var DealerOnly8 = document.getElementById('dealerOnly8');
var DealerOnly9 = document.getElementById('dealerOnly9');
var DealerOnly10 = document.getElementById('dealerOnly10');
var DealerOnly11 = document.getElementById('dealerOnly11');
var DealerOnly12 = document.getElementById('dealerOnly12');


    if(flag)
    {
        DealerOnly.style.display = 'inline-block';
        DealerOnly2.style.display = 'inline-block';
        DealerOnly3.style.display = 'inline-block';
        DealerOnly4.style.display = 'inline-block';
	DealerOnly11.style.display = 'inline-block';
	DealerOnly12.style.display = 'inline-block';
	DealerOnly5.style.display = 'none';
	DealerOnly6.style.display = 'none';
	DealerOnly7.style.display = 'none';
	DealerOnly8.style.display = 'none';
	DealerOnly9.style.display = 'none';
	DealerOnly10.style.display = 'none';

    }
    else
    {
        DealerOnly.style.display = 'none';
        DealerOnly2.style.display = 'none';
        DealerOnly3.style.display = 'none';
        DealerOnly4.style.display = 'none';
	DealerOnly5.style.display = 'inline-block';
	DealerOnly6.style.display = 'inline-block';
	DealerOnly7.style.display = 'inline-block';
	DealerOnly8.style.display = 'inline-block';
	DealerOnly9.style.display = 'inline-block';
	DealerOnly10.style.display = 'inline-block';
	DealerOnly11.style.display = 'none';
	DealerOnly12.style.display = 'none';
    }
    return false;
}

</script>



<BODY  onload="displayOptions(true)">

<center><div class="ex">

<h1> Welcome to the Create Account page </h1>

<form action="CreateAccount.php" method="post" name="registration_form" onsubmit="return Validate();">
<div align="left">
<UL>
   <li class="one">Account type:
   </li>
        <li>
        User: <input type="radio" name="acctType" value="R" onclick="displayOptions(false)" <? if(isset($_POST['AccountType']) && ($_POST['AccountType']=='R')){echo 'checked';}?>>
        Dealer: <input type="radio" name="acctType" value="D" onclick="displayOptions(true)" <? if((isset($_POST['AccountType']) && ($_POST['AccountType']=='R'))|| empty($_POST['AccountType'])){echo 'checked';}?>>
		</li>
   </li>
   <li class="one" id="dealerOnly11">
       Company Name*:
	   </li>
	   <li id="dealerOnly12">
	    <!-- fName should be cName? -->
        <input type="text" name="cName" value="<? if(isset($_POST['fName'])){echo $_POST['cName'];}?>" />
    </li>
   <li class="one" id="dealerOnly5">
       First Name*:
	   </li>
	   <li id="dealerOnly6">
        <input type="text" name="fName" value="<? if(isset($_POST['fName'])){echo $_POST['fName'];}?>" />
    </li>
    <li class="one" id="dealerOnly7">
        Middle Initial:
		</li>
		<li id="dealerOnly8">
        <input type="text" name="mInitial" size="1" maxlength="1" value="<? if(isset($_POST['mInitial'])){echo $_POST['mInitial'];}?>"/>
    </li>
    <li class="one" id="dealerOnly9">
        Last Name*:
		</li>
		<li id="dealerOnly10">
        <input type="text" name="lName" value="<? if(isset($_POST['lName'])){echo $_POST['lName'];}?>" />
    </li>
    <li class="two" id="dealerOnly3">
		URL:
		</li>
		<li id="dealerOnly4">
        <input type="text" name="URL" value="<? if(isset($_POST['URL'])){echo $_POST['URL'];}?>"/>
    </li>
    <li class="one">
        Address:
		</li>
		<li>
        <input type="text" name="address" value="<? if(isset($_POST['address'])){echo $_POST['address'];}?>" />  Ex:(123 streetname) 
    </li>
	<li class="one">
        City:
		</li>
		<li>
        <input type="text" name="city" value="<? if(isset($_POST['city'])){echo $_POST['city'];}?>" />
    </li>
    <li class="one">
        State:
		</li>
		<li>
        <input type="text" name="state" size="2" maxlength="2" value="<? if(isset($_POST['state'])){echo $_POST['state'];}?>"/>
    </li>
    <li class="one">
        Zip:
		</li>
		<li>
        <input type="text" name="zip" size="5" maxlength="5" value="<? if(isset($_POST['zip'])){echo $_POST['zip'];}?>"/>
    </li>
    <li class="one">
        Country:
		</li>
		<li>
        <input type="text" name="country" value="<? if(isset($_POST['country'])){echo $_POST['country'];}?>"/>
    </li>
    <li class="one">
        Phone Number:
		</li>
		<li>
        (<input type="text" name="phone1" size="3" maxlength="3" value="<? if(isset($_POST['phone1'])){echo $_POST['phone1'];}?>"/>) -
            <input type="text" name="phone2" size="3" maxlength="3" value="<? if(isset($_POST['phone2'])){echo $_POST['phone2'];}?>"/>-
            <input type="text" name="phone3" size="4" maxlength="4" value="<? if(isset($_POST['phone3'])){echo $_POST['phone3'];}?>"/>
    </li>
    <li class="one">
        E-Mail:</td>
		</li>
		<li>
        <input type="text" name="eMail" value="<? if(isset($_POST['eMail'])){echo $_POST['eMail'];}?>"/>
    </li>
    <li class="one">
        Username*:
		</li>
		<li>
        <input type="text" name="username"/>
    </li>
    <li class="one">
        Password*:
		</li>
		<li>
        <input type="password" name="password1"/>
    </li>
    <li class="one">
       Re-type Password*:
      </li>   
	  <li><input type="password" name="passwordReType"/> 
    </li>
    <li class="two" id="dealerOnly">
		Description:
		</li>
		<li id="dealerOnly2">
        <textarea name="Descript" Cols=40 rows=6><? if(isset($_POST['Descript'])){echo $_POST['Descript'];}?></textarea>
		</li>
    </li>

    <li class="mid">
        <input type="submit" value="Continue"/>
    </li>
    
</UL>
</div>
</form>
* Required
<br />
<br />
<a href="index.php">Return to Index</a>

</div></center>

</BODY>
</HTML>